
import { Navigate, createBrowserRouter } from "react-router-dom"
import Home from '../page/home'
import Login from "../page/login";
const routes = createBrowserRouter(
	[
		{
			path: '/home',
			element: <Home />
		},
		{
			path: '/Login',
			element: <Login />
		},
		{
			path: '/',	//当路径的端口号后面没有地址时就渲染'<Navigate>'
			element: <Navigate to="/home"/> //只要`<Navigate>`组件被渲染，就会修改路径，切换视图
		}
	]
);
export default routes;